package com.icode.core.model.house;

import com.icode.core.model.AbstractEntity;
import org.springframework.context.annotation.Lazy;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: sunk
 * Date: 15-1-13
 * Time: 上午11:10
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "building_type_image")
public class BuildingTypeImage extends AbstractEntity {
    @ManyToOne
    @JoinColumn(name = "building_type_id")
    private BuildingType buildingType;

    @ManyToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "image_id")
    private UploadImage image;

    public BuildingTypeImage() {
    }

    public BuildingTypeImage(BuildingType buildingType, UploadImage image) {
        this.buildingType = buildingType;
        this.image = image;
    }

    public BuildingType buildingType() {
        return buildingType;
    }

    public UploadImage image() {
        return image;
    }
}
